@extends('Admin.layout.layout')
@section('content')

    <div class="wrapper wrapper-content  animated fadeInRight">
        <h2>类目管理</h2>
        <div class="row">
            <div class="col-sm-4" style="width:100%;">
                <div id="nestable-menu">
                    <button type="button" data-action="expand-all" class="btn btn-white btn-sm">展开</button>
                    <button type="button" data-action="collapse-all" class="btn btn-white btn-sm">收起</button>
                    <!-- <button class="btn btn-info " type="button"><i class="fa fa-paste"></i> 保存</button> -->
                    <a class="btn-sm btn-danger sev" data-id="1"><i class="fa fa-paste"></i>保存</a>
                    <a href="" class="btn btn-sm btn-success "><i class="fa fa-refresh"></i> 刷新</a>
                    <a class="btn btn-sm btn-primary fr10"  data-toggle="modal" data-target="#addModal"style="float:right;">新增</a>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6" style="width:100%;">
                <div class="ibox ">
                    <div class="ibox-content">
                        <div class="dd" id="nestable">
                            <ol class="dd-list">
                                <li class="dd-item" data-id="1">
                                    <div class="dd-handle">1 - 视频监控
                                        <img width="40" src="{{asset('img/p1.jpg')}}">
                                    </div>
                                    <td class="center">
                                        <a class="btn-xs btn-danger del" data-id="1" style="float:right;position: relative;top:-34px;">删除</a>
                                        <a class="btn-xs btn-primary "  data-id="1"  data-toggle="modal" data-target="#editModal"style="float:right;position: relative;top:-34px;">编辑</a>
                                    </td>
                                    <ol class="dd-list">
                                        <li class="dd-item" data-id="3">
                                            <div class="dd-handle">3 - 显示器
                                            <img width="40" src="{{asset('img/p1.jpg')}}">
                                            </div>
                                            <td class="center">
                                                <a class="btn-xs btn-danger del" data-id="1" style="float:right;position: relative;top:-34px;">删除</a>
                                                <a class="btn-xs btn-primary "  data-id="1"  data-toggle="modal" data-target="#editModal"style="float:right;position: relative;top:-34px;">编辑</a>
                                            </td>
                                            <ol class="dd-list">
                                                <li class="dd-item" data-id="3">
                                                    <div class="dd-handle">3 - 显示器
                                                    <img width="40" src="{{asset('img/p1.jpg')}}">
                                                    </div>
                                                    <td class="center">
                                                        <a class="btn-xs btn-danger del" data-id="1" style="float:right;position: relative;top:-34px;">删除</a>
                                                        <a class="btn-xs btn-primary "  data-id="1"  data-toggle="modal" data-target="#editModal"style="float:right;position: relative;top:-34px;">编辑</a>
                                                    </td>
                                                </li>
                                            </ol>
                                        </li>
                                    </ol>
                                </li>
                                <li class="dd-item" data-id="2">
                                    <div class="dd-handle">2 - 显示/控制
                                    <img width="40" src="{{asset('img/p1.jpg')}}">
                                         <!-- <td class="ui-pg-button" title="删除所选记录" id="del_table_list_2"><div class="ui-pg-div" style="float:right;"><span class="glyphicon glyphicon-trash"></span></div>
                                        </td>
                                        <td class="ui-pg-button "title="编辑所选记录" id="edit_table_list_2" ><div class="ui-pg-div" style="float:right;"><span class="glyphicon glyphicon-edit"></span></div></td> -->
                                    </div>
                                    <td class="center">
                                        <a class="btn-xs btn-danger del" data-id="1" style="float:right;position: relative;top:-34px;">删除</a>
                                        <a class="btn-xs btn-primary "  data-id="1"  data-toggle="modal" data-target="#editModal"style="float:right;position: relative;top:-34px;">编辑</a>
                                    </td>
                                    <ol class="dd-list">
                                        <li class="dd-item" data-id="3">
                                            <div class="dd-handle">3 - 显示器
                                            <img width="40" src="{{asset('img/p1.jpg')}}">
                                                <!--  <td class="ui-pg-button" title="删除所选记录" id="del_table_list_2"><div class="ui-pg-div" style="float:right;"><span class="glyphicon glyphicon-trash"></span></div>
                                                </td>
                                                <td class="ui-pg-button "title="编辑所选记录" id="edit_table_list_2" ><div class="ui-pg-div" style="float:right;"><span class="glyphicon glyphicon-edit"></span></div></td> -->
                                            </div>
                                            <td class="center">
                                                <a class="btn-xs btn-danger del" data-id="1" style="float:right;position: relative;top:-34px;">删除</a>
                                                <a class="btn-xs btn-primary "  data-id="1"  data-toggle="modal" data-target="#editModal"style="float:right;position: relative;top:-34px;">编辑</a>
                                            </td>
                                        </li>
                                    </ol>
                                </li>
                                <li class="dd-item" data-id="5">
                                    <div class="dd-handle">5 - 存储
                                    <img width="40" src="{{asset('img/p1.jpg')}}">
                                    </div>
                                    <td class="center">
                                                <a class="btn-xs btn-danger del" data-id="1" style="float:right;position: relative;top:-34px;">删除</a>
                                                <a class="btn-xs btn-primary "  data-id="1"  data-toggle="modal" data-target="#editModal"style="float:right;position: relative;top:-34px;">编辑</a>
                                            </td>
                                    <ol class="dd-list">
                                       <li class="dd-item" data-id="6">
                                           <div class="dd-handle">6 - 网络录像机
                                           <img width="40" src="{{asset('img/p1.jpg')}}">
                                               <!-- <td class="ui-pg-button" title="删除所选记录" id="del_table_list_2"><div class="ui-pg-div" style="float:right;"><span class="glyphicon glyphicon-trash"></span></div>
                                                   </td>
                                                   <td class="ui-pg-button "title="编辑所选记录" id="edit_table_list_2" ><div class="ui-pg-div" style="float:right;"><span class="glyphicon glyphicon-edit"></span></div></td> -->
                                           </div>
                                           <td class="center">
                                                <a class="btn-xs btn-danger del" data-id="1" style="float:right;position: relative;top:-34px;">删除</a>
                                                <a class="btn-xs btn-primary "  data-id="1"  data-toggle="modal" data-target="#editModal"style="float:right;position: relative;top:-34px;">编辑</a>
                                            </td>
                                       </li>
                                       <li class="dd-item" data-id="7">
                                           <div class="dd-handle">7 - 同轴录像机
                                           <img width="40" src="{{asset('img/p1.jpg')}}">
                                               <!-- <td class="ui-pg-button" title="删除所选记录" id="del_table_list_2"><div class="ui-pg-div" style="float:right;"><span class="glyphicon glyphicon-trash"></span></div>
                                               </td>
                                               <td class="ui-pg-button "title="编辑所选记录" id="edit_table_list_2" ><div class="ui-pg-div" style="float:right;"><span class="glyphicon glyphicon-edit"></span></div></td> -->
                                           </div>
                                           <td class="center">
                                                <a class="btn-xs btn-danger del" data-id="1" style="float:right;position: relative;top:-34px;">删除</a>
                                                <a class="btn-xs btn-primary "  data-id="1"  data-toggle="modal" data-target="#editModal"style="float:right;position: relative;top:-34px;">编辑</a>
                                            </td>
                                       </li>
                                       <li class="dd-item" data-id="7">
                                           <div class="dd-handle">7 - 模拟录像机
                                           <img width="40" src="{{asset('img/p1.jpg')}}">
                                           <!-- <td class="ui-pg-button" title="删除所选记录" id="del_table_list_2"><div class="ui-pg-div" style="float:right;"><span class="glyphicon glyphicon-trash"></span></div>
                                               </td>
                                               <td class="ui-pg-button "title="编辑所选记录" id="edit_table_list_2" ><div class="ui-pg-div" style="float:right;"><span class="glyphicon glyphicon-edit"></span></div></td> -->
                                           </div>
                                           <td class="center">
                                                <a class="btn-xs btn-danger del" data-id="1" style="float:right;position: relative;top:-34px;">删除</a>
                                                <a class="btn-xs btn-primary "  data-id="1"  data-toggle="modal" data-target="#editModal"style="float:right;position: relative;top:-34px;">编辑</a>
                                            </td>
                                       </li>
                                   </ol>
                                </li>
                            </ol>
                        </div>
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">
                                    <ul class="pagination">
                                        <li class="paginate_button previous" aria-controls="editable" tabindex="0" id="editable_previous">
                                            <a href="#">上一页</a>
                                        </li>
                                        <li class="paginate_button " aria-controls="editable" tabindex="0">
                                            <a href="#">1</a>
                                        </li>
                                        <li class="paginate_button " aria-controls="editable" tabindex="0">
                                            <a href="#">2</a>
                                        </li>
                                        <li class="paginate_button " aria-controls="editable" tabindex="0">
                                            <a href="#">3</a>
                                        </li>
                                        <li class="paginate_button active" aria-controls="editable" tabindex="0">
                                            <a href="#">4</a>
                                        </li>
                                        <li class="paginate_button " aria-controls="editable" tabindex="0">
                                            <a href="#">5</a>
                                        </li>
                                        <li class="paginate_button " aria-controls="editable" tabindex="0">
                                            <a href="#">6</a>
                                        </li>
                                        <li class="paginate_button next" aria-controls="editable" tabindex="0" id="editable_next">
                                            <a href="#">下一页</a>
                                        </li>
                                        <li>&nbsp;&nbsp;共437页，到第&nbsp;&nbsp;<input type="text" class="g-input">&nbsp;页&nbsp;<input type="button" onclick="" value="确定" class="btn btn-sm btn-primary"></input>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox ">
                    <div class="dd" id="nestable2">
                    </div>
                </div>
            </div> 
        </div>
    </div>
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-hidden="true">×
                </button>
                <h4 class="modal-title" id="addModalLabel">
                    创建类目
                </h4>
            </div>
            <form class="form-horizontal m-t" id="addForm">
            <div class="modal-body">
                <div class="form-group">
                   <label class="col-sm-3 control-label" style="margin-right: 15px;">一级菜单：</label>
                    <div class="input-group col-sm-8">
                        <select id="first" name="first" data-placeholder="Root" class="chosen-select form-control" style="width:350px;" tabindex="2">
                            <option value="1">一级菜单</option>
                            <option value="110000" hassubinfo="true">北京</option>
                            <option value="120000" hassubinfo="true">天津</option>
                            <option value="130000" hassubinfo="true">河北省</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                   <label class="col-sm-3 control-label" style="margin-right: 15px;">二级菜单：</label>
                    <div class="input-group col-sm-8">
                        <select id="second" name="second" data-placeholder="Root" class="chosen-select form-control" style="width:350px;" tabindex="2">
                            <option value="2">二级菜单</option>
                            <option value="210000" hassubinfo="true">北京</option>
                            <option value="220000" hassubinfo="true">天津</option>
                            <option value="230000" hassubinfo="true">河北省</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                   <label class="col-sm-3 control-label">分类名称：</label>
                    <div class="col-sm-8">
                        <input id="addname" name="addname" class="form-control" type="text" placeholder="分类名称">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">分类编码：</label>
                    <div class="col-sm-8">
                        <input id="kindscode" name="kindscode" class="form-control" type="text" placeholder="分类编码">
                    </div>
                </div>
                <div class="form-group">
                   <label class="col-sm-3 control-label">分类别名：</label>
                    <div class="col-sm-8">
                        <input id="petname" name="petname" class="form-control" type="text" placeholder="分类别名">
                    </div>
                </div>
                <div class="form-group">
                   <label class="col-sm-3 control-label">首字母：</label>
                    <div class="col-sm-2">
                        <input id="Initials" name="Initials" class="form-control" type="text" placeholder="Y" value="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">排序：</label>
                    <div class="col-sm-2">
                        <input id="sort" name="sort" class="form-control" type="text" placeholder="0" value="">
                    </div>
                </div>
                <div class="form-group">
                     <label class="col-sm-3 control-label">ICO：</label>
                    <div class="col-sm-8">
                        <img id="imgContent" style="width: 80px;height: 80px;">
                        <div class="btn-group">
                            <label title="上传图片" for="inputImage" class="btn btn-primary">
                                <input type="file" accept="image/*" name="inputImage" id="inputImage" class="hide" multiple="false"> 上传图片
                            </label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                   <label class="col-sm-3 control-label">属性：</label>
                    <div class="checkbox checkbox-inline">
                        <input type="checkbox" id="inlineCheckbox"  value="option1" style="margin-top:1px;">
                        <label for="inlineCheckbox" style="padding-left: 0;">组件</label>
                     </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary" id="add_submit">
                    确定
                </button>
                <button type="button" class="btn btn-default"
                        data-dismiss="modal" >取消
                </button>
            </div>
            </form>
        </div>
    </div>
</div>
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-hidden="true">×
                </button>
                <h4 class="modal-title" id="editModalLabel">
                    修改类目
                </h4>
            </div>
            <form class="form-horizontal m-t" id="editForm">
            <div class="modal-body">
                <div class="form-group">
                    <label class="col-sm-3 control-label">ID：</label>
                    <div class="col-sm-8">
                        <input id="editid" name="editid" class="form-control" type="text" placeholder="1">
                    </div>
                </div>
                 <div class="form-group">
                   <label class="col-sm-3 control-label" style="margin-right: 15px;">一级菜单：</label>
                    <div class="input-group col-sm-8">
                        <select id="editfirst" name="editfirst" data-placeholder="Root" class="chosen-select form-control" style="width:350px;" tabindex="2">
                            <option value="1">一级菜单</option>
                            <option value="110000" hassubinfo="true">北京</option>
                            <option value="120000" hassubinfo="true">天津</option>
                            <option value="130000" hassubinfo="true">河北省</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                   <label class="col-sm-3 control-label" style="margin-right: 15px;">二级菜单：</label>
                    <div class="input-group col-sm-8">
                        <select id="editsecond" name="editsecond" data-placeholder="Root" class="chosen-select form-control" style="width:350px;" tabindex="2">
                            <option value="2">二级菜单</option>
                            <option value="210000" hassubinfo="true">北京</option>
                            <option value="220000" hassubinfo="true">天津</option>
                            <option value="230000" hassubinfo="true">河北省</option>
                        </select>
                    </div>
                </div>
                 <div class="form-group">
                   <label class="col-sm-3 control-label">分类名称：</label>
                    <div class="col-sm-8">
                        <input id="editname" name="editname" class="form-control" type="text" placeholder="分类名称">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">分类编码：</label>
                    <div class="col-sm-8">
                        <input id="editkindscode" name="editkindscode" class="form-control" type="text" placeholder="分类编码">
                    </div>
                </div>
                <div class="form-group">
                   <label class="col-sm-3 control-label">分类别名：</label>
                    <div class="col-sm-8">
                        <input id="editpetname" name="editpetname" class="form-control" type="text" placeholder="分类别名">
                    </div>
                </div>
                <div class="form-group">
                   <label class="col-sm-3 control-label">首字母：</label>
                    <div class="col-sm-2">
                        <input id="editInitials" name="editInitials" class="form-control" type="text" placeholder="Y" value="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">排序：</label>
                    <div class="col-sm-2">
                        <input id="editsort" name="editsort" class="form-control" type="text" placeholder="0" value="">
                    </div>
                </div>
                 <div class="form-group">
                     <label class="col-sm-3 control-label">ICO：</label>
                    <div class="col-sm-8">
                        <!-- <img id="labelimg" src="{{asset('img/p1.jpg')}}"> -->
                        <img id="imgContent1" style="width: 80px;height: 80px;">
                        <div class="btn-group">
                            <label title="上传图片" for="inputImage1" class="btn btn-primary">
                                <input type="file" accept="image/*" name="file" id="inputImage1" class="hide" multiple="false"> 上传图片
                            </label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                   <label class="col-sm-3 control-label">属性：</label>
                    <div class="checkbox checkbox-inline">
                        <input type="checkbox" id="editinlineCheckbox"  value="option1" style="margin-top:1px;">
                        <label for="editinlineCheckbox" style="padding-left: 0;">组件</label>
                     </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary" id="edit_submit">
                    确定
                </button>
                <button type="button" class="btn btn-default"
                        data-dismiss="modal" >取消
                </button>
            </div>
            </form>
        </div>
    </div>
</div>
    <!-- Nestable List -->
    <script src="{{asset('js/plugins/nestable/jquery.nestable.js')}}"></script>
    <script src="{{asset('js/plugins/validate/jquery.validate.min.js')}}"></script>
    <script src="{{asset('js/plugins/validate/messages_zh.min.js')}}"></script>
    <script src="{{asset('js/plugins/layer/layer.min.js')}}"></script>
    <script src="{{asset('js/plugins/treeview/bootstrap-treeview.js')}}"></script>
    <script src="{{asset('js/demo/treeview-demo.js')}}"></script>
   <script>
        $(document).ready(function () {
            var updateOutput = function (e) {
                var list = e.length ? e : $(e.target),
                    output = list.data('output');
                if (window.JSON) {
                    output.val(window.JSON.stringify(list.nestable('serialize'))); //, null, 2));
                } else {
                    output.val('浏览器不支持');
                }
            };
            // activate Nestable for list 1
            $('#nestable').nestable({
                group: 1
            }).on('change', updateOutput);

            // activate Nestable for list 2
            $('#nestable2').nestable({
                group: 1
            }).on('change', updateOutput);
            // output initial serialised data
            updateOutput($('#nestable').data('output', $('#nestable-output')));
            updateOutput($('#nestable2').data('output', $('#nestable2-output')));

            $('#nestable-menu').on('click', function (e) {
                var target = $(e.target),
                    action = target.data('action');
                if (action === 'expand-all') {
                    $('.dd').nestable('expandAll');
                }
                if (action === 'collapse-all') {
                    $('.dd').nestable('collapseAll');
                }
            });
            //新增上传图片
            function upload(file){
                var reader = new FileReader();  
                //创建文件读取相关的变量  
                var imgFile;  
                //为文件读取成功设置事件  
                reader.onload=function(e) {  
                    imgFile = e.target.result; 
                    $("#imgContent").attr('src', imgFile);  
                };  
                //正式读取文件  
                reader.readAsDataURL(file);
            }
            $('#inputImage').change(function(img){
                 upload(this.files[0]);
                var files =  this.files[0];
                var formFile = new FormData();   
                formFile.append("file", files);
                $.ajax({
                    url: "",
                    type: 'post',
                    data: formFile,
                    contentType: false,  
                    processData: false, 
                    success: function(data) {
                       console.log(1);
                    },
                    error: function(data) {
                       console.log("error");
                    }
                });
            })
            var edit_id = 0;//修改属性的id
            // validate signup form on keyup and submit
            var icon = "<i class='fa fa-times-circle'></i> ";
            //新增
            $("#addForm").validate({
                rules: {
                    first: "required",
                    second: "required",
                    addname: "required",
                    kindscode: "required",
                    petname: "required",
                    Initials: "required",
                    sort: "required",
                    inlineCheckbox: "required"
                },
                messages: {
                    first: icon + "请输入一级菜单",
                    second: icon + "请输入二级菜单",
                    addname: icon + "请输入分类名称",
                    kindscode: icon + "请输入分类编码",
                    petname: icon + "请输入分类别名",
                    Initials: icon + "请输入首字母",
                    sort: icon + "请排序",
                    inlineCheckbox: icon + "请选择属性"
                },
                submitHandler:function(form){
                    var first = $('#first').val();
                    var second = $('#second').val();
                    var addname = $('#addname').val();
                    var kindscode = $('#kindscode').val();
                    var petname = $('#petname').val();
                    var Initials = $('#Initials').val();
                    var sort = $('#sort').val();
                    var inlineCheckbox = $('#inlineCheckbox').val();
                    console.log(inlineCheckbox);
                    $.ajax({
                        url : '',
                        type : 'post',
                        contentType : "json",
                        data : {},
                        success : function(data) {
                            if (0 == data.code) {
                                layer.alert(data.message, {
                                    icon: 1
                                }, function () {
                                    location.reload();
                                });
                            } else {
                                layer.alert(data.message, {
                                    icon: 2
                                });
                            }
                        }
                    });
                }
            });

            $('#editModal').on('show.bs.modal', function (e) {
                edit_id = $(e.relatedTarget).attr("data-id");//编辑时属性的id
            })
            //编辑
            $("#editForm").validate({
                rules: {
                    editid: "required",
                    editfirst: "required",
                    editsecond: "required",
                    editname: "required",
                    editkindscode: "required",
                    editpetname: "required",
                    editInitials: "required",
                    editsort: "required",
                    editinlineCheckbox: "required"
                },
                messages: {
                    editid: icon + "请输入ID",
                    editname: icon + "请输入一级菜单",
                    editsecond: icon + "请输入二级菜单",
                    editname: icon + "请输入分类名称",
                    editkindscode: icon + "请输入分类编码",
                    editpetname: icon + "请输入分类别名",
                    editInitials: icon + "请输入首字母",
                    editsort: icon + "请排序",
                    editinlineCheckbox: icon + "请选择属性"
                },
                submitHandler:function(form){
                    var editid = $('#editid').val();
                    var editname = $('#editname').val();
                    var editsecond = $('#editsecond').val();
                    var editname = $('#editname').val();
                    var editkindscode = $('#editkindscode').val();
                    var editpetname = $('#editpetname').val();
                    var editInitials = $('#editInitials').val();
                    var editsort = $('#editsort').val();
                    var editinlineCheckbox = $('#editinlineCheckbox').val();
                    $.ajax({
                        url : '',
                        type : 'post',
                        contentType : "json",
                        data : {},
                        success : function(data) {
                            if (0 == data.code) {
                                layer.alert(data.message, {
                                    icon: 1
                                }, function () {
                                    location.reload();
                                });
                            } else {
                                layer.alert(data.message, {
                                    icon: 2
                                });
                            }
                        }
                    });
                }
            });
            //删除
            $('.del').click(function(){
                console.log($('.del'))
                var id = $(this).attr('data-id');
                layer.confirm('是否删除？', {
                    btn: ['确认', '取消'] //可以无限个按钮
                }, function (index) {
                    $.ajax({
                        url: '',
                        type: 'GET',
                        dataType: 'json',
                        data: {'id': id},
                        success: function (data) {
                            if (0 == data.code) {
                                layer.alert(data.message, {
                                    icon: 1
                                }, function () {
                                    location.reload();
                                });
                            } else {
                                layer.alert(data.message, {
                                    icon: 2
                                });
                            }
                        }
                    });
                }, function (index, layero) {
                    layer.close(index);
                });
            })
            //保存
            $('.sev').click(function(){
                console.log($('.del'))
                var id = $(this).attr('data-id');
                layer.confirm('是否保存？', {
                    btn: ['确认', '取消'] //可以无限个按钮
                }, function (index) {
                    $.ajax({
                        url: '',
                        type: 'GET',
                        dataType: 'json',
                        data: {'id': id},
                        success: function (data) {
                            if (0 == data.code) {
                                layer.alert(data.message, {
                                    icon: 1
                                }, function () {
                                    location.reload();
                                });
                            } else {
                                layer.alert(data.message, {
                                    icon: 2
                                });
                            }
                        }
                    });
                }, function (index, layero) {
                    layer.close(index);
                });
            })
        });
    </script>
@endsection
